const USERINFO = 'gl_userinfo';
const PRODUCT = 'gl_product';

// 获取当前用户信息
const getUserInfo = () => JSON.parse(localStorage.getItem(USERINFO)) || {};
// 设置当前用户信息
const setUserInfo = value => localStorage.setItem(USERINFO, JSON.stringify(value));
// 删除当前用户信息
const deleteUserInfo = () => localStorage.removeItem(USERINFO);

// 获取商品-商品管理
const getProduct = () => JSON.parse(localStorage.getItem(PRODUCT)) || {};
// 设置商品-商品管理
const setProduct = value => localStorage.setItem(PRODUCT, JSON.stringify(value));
// 删除商品-商品管理
const deleteProduct = () => localStorage.removeItem(PRODUCT);

export { getUserInfo, setUserInfo,deleteUserInfo,getProduct,setProduct,deleteProduct }
